package com.boot.proofing.mpweb.ito.crontab;/**
 * @description
 * @autor xbwu on 2018/12/3.
 */

import org.quartz.DisallowConcurrentExecution;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.Instant;

/**
 * 测试定时任务
 * @author xbwu
 * @create 2018-12-03 
 **/
/**
 * 当上一个任务未结束时下一个任务需进行等待
 */
@DisallowConcurrentExecution
@Component
public class TestQuartz{
    /**
     * 执行定时任务,每5小时执行一次
     */
    @Scheduled(cron = "0 0 0/5 * * ?")
    protected void executeInternal(){
        System.out.println("小彬定时任务测试！ "+ Instant.now());
    }
}